#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM registry.cn-shanghai.aliyuncs.com/yangww/dotnetruntime:v1.0 AS base
WORKDIR /app
EXPOSE 80

FROM registry.cn-shanghai.aliyuncs.com/yangww/dotnetsdk:v1.0 AS build
WORKDIR /src
COPY ["CapDemo.csproj", ""]
RUN dotnet restore "./CapDemo.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "CapDemo.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "CapDemo.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CapDemo.dll"]